package com.eightbears.beboy.adapter;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.entity.TagsEntity;
import com.socks.library.KLog;


//技师列表
public class TagPopAdapter extends BaseQuickAdapter<TagsEntity.DataBean, BaseViewHolder> {
    int strokeWidth = 5; // 3dp 边框宽度
    int roundRadius = 10; // 8dp 圆角半径
//    int strokeColor = Color.parseColor("#2E3135");//边框颜色
//    int fillColor = Color.parseColor("#DFDFE0");//内部填充颜色

    int chickNum = 0;

    public TagPopAdapter(Context context) {
        super(R.layout.item_gril_tag_list, null);
        Context context1 = context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, TagsEntity.DataBean listBean) {
        KLog.e("item" + listBean);
        GradientDrawable gd = new GradientDrawable();//创建drawable
        gd.setColor(Color.parseColor("#f0f0f0"));
        gd.setCornerRadius(roundRadius);
        TextView tv_tags = baseViewHolder.getView(R.id.tv_tags);
        tv_tags.setText(listBean.getName());
        tv_tags.setBackgroundDrawable(gd);
        tv_tags.setTextColor(Color.parseColor("#999999"));
        baseViewHolder.addOnClickListener(R.id.tv_tags);
        if (listBean.isCheck()) {
            gd.setColor(Color.parseColor(listBean.getBg_color()));
            tv_tags.setBackgroundDrawable(gd);
            tv_tags.setTextColor(Color.parseColor(listBean.getText_color()));
        } else {
            tv_tags.setBackgroundDrawable(gd);
            gd.setColor(Color.parseColor("#f0f0f0"));
            tv_tags.setTextColor(Color.parseColor("#999999"));
        }
        KLog.e(chickNum);
    }
}
